// src/utils/theme.js
export const THEME_COLORS = [
  { name: "天空蓝", value: "rgb(135, 206, 235)" },
  { name: "热情红", value: "rgb(254, 116, 142)" },
  { name: "活力橙", value: "rgb(255, 165, 0)" },
];

export const setTheme = (color) => {
  document.documentElement.style.setProperty("--primary-color", color);
  const gradient = `linear-gradient(to bottom right, rgb(255, 255, 255) 10%, ${color} 90%)`;
  document.documentElement.style.setProperty("--primary-gradient", gradient);
  localStorage.setItem("themeColor", color);
};

export const initTheme = () => {
  const savedColor = localStorage.getItem("themeColor");
  if (savedColor) setTheme(savedColor);
};
